only use debug log level for discovery traces to decrease cost
authorMatthieu Gallien <matthieu.gallien@nextcloud.com>
Tue, 4 Feb 2025 13:24:40 +0000 (14:24 +0100)
committerMatthieu Gallien <matthieu.gallien@nextcloud.com>
Thu, 6 Feb 2025 08:44:55 +0000 (09:44 +0100)
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
src/libsync/syncengine.cpp

index 8367dfa40796a47a5e486d9b113d458a84f57431..21b20beb42a2edabbe673dea63504eb1db1e817f 100644 (file)
@@ -1216,9 +1216,9 @@ void SyncEngine::setLocalDiscoveryOptions(LocalDiscoveryStyle style, std::set<QS
     _localDiscoveryStyle = style;
     _localDiscoveryPaths = std::move(paths);
 
-    if (lcEngine().isInfoEnabled() && !_localDiscoveryPaths.empty()) {
+    if (lcEngine().isDebugEnabled() && !_localDiscoveryPaths.empty()) {
         // only execute if logging is enabled
-        auto debug = qInfo(lcEngine);
+        auto debug = qDebug(lcEngine);
         debug << "paths to discover locally";
         for (auto path : _localDiscoveryPaths) {
             debug << path;
@@ -1275,12 +1275,12 @@ bool SyncEngine::shouldDiscoverLocally(const QString &path) const
         if (it != _localDiscoveryPaths.begin() && path.startsWith(*(--it))) {
             result = it->endsWith('/') || (path.size() > it->size() && path.at(it->size()) <= '/');
             if (!result) {
-                qCInfo(lcEngine()) << path << "no local discovery needed";
+                qCDebug(lcEngine()) << path << "no local discovery needed";
             }
             return result;
         }
         result = false;
-        qCInfo(lcEngine()) << path << "no local discovery needed";
+        qCDebug(lcEngine()) << path << "no local discovery needed";
         return result;
     }
 
@@ -1300,12 +1300,12 @@ bool SyncEngine::shouldDiscoverLocally(const QString &path) const
         ++it;
         if (it == _localDiscoveryPaths.end() || !it->startsWith(path)) {
             result = false;
-            qCInfo(lcEngine()) << path << "no local discovery needed";
+            qCDebug(lcEngine()) << path << "no local discovery needed";
             return result;
         }
     }
 
-    qCInfo(lcEngine()) << path << "no local discovery needed";
+    qCDebug(lcEngine()) << path << "no local discovery needed";
     return result;
 }